package com.shang.activity.controller;

import com.alibaba.fastjson.JSONObject;
import com.shang.activity.domain.SignUp;
import com.shang.activity.domain.vo.SignUpReq;
import com.shang.activity.service.SignUpService;
import com.shang.common.core.domain.R;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

import static com.shang.common.core.web.domain.AjaxResult.success;

/**
 * @Author：尚志豪
 * @Package：com.shang.activity.controller
 * @Project：ruoyi
 * @name：SignUpController
 * @Date：2024/8/18 16:05
 * 人员管理
 */
@RestController
@RequestMapping("/signUp")
@Log4j2
public class SignUpController
{
    @Autowired
    private SignUpService signUpService;
    @Autowired
    private HttpServletRequest request;
    /**
     * 人员列表
     */
    @PostMapping("/list")
    public R list(@RequestBody SignUpReq req)
    {
        log.info("人员列表 请求URI:{}, 请求方式{}, 请求参数{},",request.getRequestURI(),request.getMethod(), JSONObject.toJSONString(req));
        List<SignUp> list = signUpService.list(req);
        log.info("人员列表 请求URI:{}, 请求方式{}, 结果{},",request.getRequestURI(),request.getMethod(), JSONObject.toJSONString(list));
        return R.ok(list);

    }
}
